from utils.msg_queue import connect_message_queue


di = {
    "order_id": "56d3febc981d74ac964ac3375a0d9f84",
    "short_title":"介绍一下K8S",
    "user_id":"123",
}
query = 'finance'
queue_name = 'unsplash_%s' % (query,)
q = connect_message_queue(queue_name, url="redis://192.168.1.22:6379/1", maxsize=10, lazy_limit=True)
queue_count = 1
queue_names = {}

for j in range(50):
    if q.full():
        queue_count += 1
        new_queue_name = "%s_%s" % (queue_name, queue_count)
        queue_names[queue_name] = (queue_name)
        # print("Current queue full, creating new queue: %s" % new_queue_name)

        q = connect_message_queue(new_queue_name, url="redis://192.168.1.22:6379/1", maxsize=10, lazy_limit=True)

    q.put(di)